<?php
if ($this->isAjax == "") {
?>

<div class="page-header">
    <h1>
        Member
        <small>
            <i class="icon-double-angle-right"></i>
            Reset Password

        </small>
    </h1>
</div>

<?php
}

if ($this->msg) {
    ?>
    <div class="alert alert-info">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-ok"></i>
        </strong>

        <?php echo $this->msg; ?>
        <br />
    </div>
<?php
}


if ($this->errmsg) {
    ?>
    <div class="alert alert-danger">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-remove"></i>

        </strong>

        <?php echo $this->errmsg; ?>
        <br />
    </div>
<?php
}
?>


<?php
if ($this->isAjax == "") {
?>
<div class="row">
        <div class="col-xs-11">
            <!-- PAGE CONTENT BEGINS -->

            <form id="frm" class="form-horizontal" role="form" action="" method="post" onsubmit="return resetPass()">
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="accNum"> Member ID </label>
                    <div class="col-sm-9">
                            <input type="text" class="width-30" name="accNum" id="accNum" placeholder="Member ID" value="" required></input>
                            <button class="btn btn-success btn-sm" type="submit">
                                <i id="ibtn" class="icon-key icon-on-right bigger-110"></i>
                                Reset
                            </button>
                    </div>
                </div>
        </form>
            
        

        <!-- PAGE CONTENT ENDS -->
    </div>
</div>
<script>

    function resetPass(){

           var accNum = $('#accNum').val();

           //$("#ibtn").attr('class', 'icon-key icon-on-right bigger-110');
           $("#ibtn").toggleClass('icon-spinner icon-spin icon-on-right bigger-110');
           //icon-spinner icon-spin white bigger-125
           $.ajax({
                type: 'POST',
                dataType: 'text',
                url: 'resetpass',
                data: {accNum: accNum, isAjax: 1},
                success: function(result){

                        $("#ibtn").attr('class','icon-key icon-on-right bigger-110');
                        
                        bootbox.dialog({
                                message: "<span class='bigger-110'>"+ result+"</span>",
                                buttons:
                                {
                                        "success" :
                                         {
                                                "label" : "<i class='icon-ok'></i> Ok!",
                                                "className" : "btn-sm btn-success",

                                        }
                                }
                        });

                     }
                });

           return false;
    }

</script>

<?php
}
?>



